
begintalkscript;

variables;

begintalknode 10;
	state = -1;
	nextstate = 10;
	question = "Brother Dogwood";
	text1 = "A young-looking druid stands by the fountain in the middle of this temple. He appears completely at ease, undisturbed by the sudden presence of a group of adventurers.";
	text2 = "_Greetings, adventurers. What brings you to this temple?_ he asks.";
	text5 = "Brother Dogwood tranquilly waits for you to speak.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	question = "Why is this temple inside a hedge?";
	text1 = "Brother Dogwood looks at you strangely.";
	text2 = "_This IS the temple. Many of our temples are basically overgrown hedges, when you think of it._";

begintalknode 12;
	state = 11;
	nextstate = -1;
	question = "Why do you build them that way?";
	text1 = "_Well, we don't really build them, we grow them from seeds. A lot of seeds, usually ones blessed at the Order Temple._";
	text2 = "_Really, it's just easier for us to grow a temple. Saves a lot of work, though it does take more fertilizer._";

begintalknode 13;
	state = 10;
	nextstate = 12;
	question = "Are there any services this temple offers?";
	text1 = "_Well, I can completely restore your party for 400 gold. It's not a perfect spell, but I'm working on it._";
	text2 = "_Other than that, we just offer a quiet place for Order members to meditate and reflect upon life. Or sleep... you can do that too._";

begintalknode 14;
	state = 12;
	nextstate = -1;
	question = "Sure, can you heal us? (400 gold)";
	text1 = "_Alright then, just relax._";
	text2 = "Brother Dogwood begins muttering some sort of healing spell, and a feeling of immense relief floods through you. You notice that the small pool of water in the fountain is glowing, as if filled with some sort of holy energy.";
	text3 = "_I'm sorry, I usually charge 400 gold. The temple needs fertilizer, after all._";
	text5 = "_Well, good to see that adventurers can still take care of themselves._";
	action = END_TALK;
	code = 
		clear_strings();
		if (coins_amount() < 400) {
			add_string(3);
		}
		else {
		play_sound(24);
		add_string(1);
		add_string(2);
		revive_party();
		change_coins(-400);
	}
	break;
begintalknode 15;
	state = 12;
	nextstate = -1;
	question = "No thanks, we don't really need any healing right now.";
	text1 = "_Okay, just come see me again if you need healing._";
	action = END_TALK;

begintalknode 20;
	state = -1;
	nextstate = 20;
	question = "Alia";
	text1 = "You approach the bar of the Drunken Flounder and see the innkeeper, a woman most likely in her fourties. She polishes a glass and watches you, just to make sure you're not already drunk.";
	text2 = "_The name's Alia, and this is the Drunken Flounder Inn. Anything I can do for you?_";
	text5 = "Alia is still here, polishing what looks like the same glass as last time.";
	text6 = "_Well, what do you all want?_";
	action = INTRO;

begintalknode 21;
	state = 20;
	nextstate = -1;
	question = "We'll have a round of ale. (8 gold)";
	text1 = "_Okay, here you go._";
	text2 = "The ale isn't bad, but not the best. You detect a hint of herbal tea, but you're not sure why. Must be a _unique_ recipe.";
	text3 = "_Well, I'd prefer if you could actually pay for that._";
	code = 
		clear_strings();
		if (coins_amount() >= 8) {
			change_coins(-8);
			set_party_status(28,10,0);
			add_string(1);
			add_string(2);
		}
		else {
		add_string(3);
	}
	break;
begintalknode 22;
	state = 20;
	nextstate = -1;
	question = "We'll take a room for the night. (20 gold)";
	text1 = "_Gladly. We've got a spare room just down the hall. Should be nice and quiet._";
	text2 = "_Enjoy your stay, and don't forget about our free continental breakfast! One thing though, it's not free..._";
	text3 = "_Sorry, but I'd prefer if you could actually pay. I can't house non-paying customers, it's just bad business._";
	text5 = "_Sorry, but we don't allow horses in the rooms. If you want, you can leave them out front, then talk to me later. They'll be safe in this town._";
	action = INN 0 0 0;

begintalknode 23;
	state = 20;
	nextstate = -1;
	question = "Can we get some food?";
	text1 = "_Anything else?_";
	code = 
		begin_shop_mode("Drunken Flounder", "Alia promises that all of her food is worthwhile, and it certainly looks good. In particular, the sandwiches look tempting.", 5, 3, -1);
	break;
begintalknode 24;
	state = 20;
	nextstate = -1;
	question = "Hear any interesting news lately?";
	text1 = "Alia looks you questioningly, as if you're stupid or something.";
	text2 = "_Well, there's Ephesos's disappearance, and the lizards roaming the valleys, but beyond that, nothing really interesting._ she says, her voice dripping with sarcasm.";
	text3 = "_We're a little preoccupied with restoring order to the valley to worry about much else._";

begintalknode 25;
	state = -1;
	nextstate = -1;
	question = "Drunk";
	text1 = "This man is far too drunk to say anything at all. He gurgles at you, then passes out on the bar.";

begintalknode 26;
	state = -1;
	nextstate = -1;
	question = "Townsperson";
	text1 = "You approach this man, even though he appears to be in a rather heated discussion with the man seated across from him.";
	text2 = "Suddenly, he notices you. _Can't you see we're in the middle of something? Leave us alone!_";

begintalknode 27;
	state = -1;
	nextstate = -1;
	question = "Townsperson";
	text1 = "This woman barely acknowledges you before turning back to watch the men arguing at the other table. It appears that she doesn't want to talk with you right now.";

begintalknode 30;
	state = -1;
	nextstate = 30;
	question = "Ian";
	text1 = "The merchant behind the counter quickly gives you the once-over, realizing that you're not an average customer.";
	text2 = "_My name is Ian, and I'm Relias's one and only toolsmith. May I help you?_";
	text5 = "Ian's still here, waiting for you to buy something.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	question = "May I see your wares?";
	text1 = "_Pleasure doing business with you._";
	action = END_TALK;
	code = 
		begin_shop_mode("Ian's Tools", "Ian shows you a rather unimpressive array of tools, though some of it looks useful. He also offers to buy any excess treasure you've collected.", 2, 3, 4);
	break;
begintalknode 32;
	state = 30;
	nextstate = -1;
	question = "I don't think I need any tools right now.";
	text1 = "_Oh... okay._";
	text2 = "With that, Ian seems to lose most of his energy. He slumps back into his chair, waiting for another customer.";

begintalknode 35;
	state = -1;
	nextstate = 35;
	question = "Helen";
	text1 = "The woman behind the counter is polishing a crossbow, and it looks like she could fire it with pretty good accuracy.";
	text2 = "_The name's Helen, and I'm the best fletcher in this valley. How can I help you?_";
	text5 = "Helen waits for you to speak, still polishing her crossbow.";
	action = INTRO;

begintalknode 36;
	state = 35;
	nextstate = -1;
	question = "Can I buy something?";
	text1 = "Helen returns to polishing her crossbow.";
	action = END_TALK;
	code = 
		begin_shop_mode("Helen's Bows", "Helen appears to be a fairly good archer, and her stock shows her appreciation of the craft. She calmly waits for you to buy something.", 3, 2, -1);
	break;
begintalknode 37;
	state = 35;
	nextstate = -1;
	question = "I don't think I need anything right now.";
	text1 = "_Then I guess we have nothing more to discuss._";
	action = END_TALK;

begintalknode 40;
	state = -1;
	nextstate = 40;
	question = "Delran";
	text1 = "This blacksmith seems totally absorbed in his work. He continues working on what looks like a spearhead for a few minutes before plunging it into a large bucket of water beside his anvil. As the steam clears, he finally notices you.";
	text2 = "_Sorry 'bout that... got a little carried away, I guess. Name's Delran, and I take care of any metalworking this town needs. Anything I can get you?_";
	text5 = "Delran picks up a fresh piece of glowing hot metal from the forge and starts pounding it into shape.";
	text6 = "_Well?_";
	action = INTRO;

begintalknode 41;
	state = 40;
	nextstate = -1;
	question = "So, what exactly do you do here?";
	text1 = "_Well, in addition to forging just about all the high-quality construction metal this town needs, I also make weapons. You know, daggers, pikes, swords... that kind of thing. And I make some armor, when I've got the time._";
	code = 
		if(get_flag(5,4) != 1)  {
			set_flag(5,4,1);
		}
	break;
begintalknode 42;
	state = 40;
	nextstate = -1;
	condition = get_flag(5,4) == 1;
	question = "Can I get some weapons?";
	text1 = "_Happy to have helped._";
	code = 
		begin_shop_mode("Delran's Forge", "Delran really puts his heart into his work, and every hammer blow you hear affirms this. He seems to have some misplaced anger issues, but at least he found an appropriate outlet.", 9, 3, -1);
	break;
begintalknode 50;
	state = -1;
	nextstate = 50;
	question = "Mayor Irving M.";
	text1 = "This aging man appears to be buried in an avalanche of paperwork, which is really quite natural for an Empire ruler. You're not sure if it's the same around here, but some things never change.";
	text2 = "Even though this man looks like he's been doing this job for a long time, he appears to enjoy it, or at least tolerate it. ";
	text3 = "He looks up from his writing for a minute and notices you. _Greetings, adventurers. I'm the mayor of Relias, Irving Maler. How can our town help you?_";
	text5 = "The mayor waits for you to speak, setting his pen aside.";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	question = "Is there anything around town that needs to be taken care of?";
	text1 = "He clears his throat. _Well, as you know, things are a little chaotic with Brother Ephesos gone right now. Supposedly, there have been encounters with packs of lizards up in the mines west of here._";
	text2 = "_We'd be rather grateful if you could help clear out the mines._";
	text3 = "He pauses for a minute. _Well, since you cleared the lizards out of the mines, it's been pretty peaceful around here. Our guards can take care of any lizards that show up._";
	text4 = "_The best service you can render us now is to help Brother Oakleaf find Ephesos. We can hold our own until then._";
	code = 
		clear_strings();
		if (get_flag(200, 1) != 1) { //Haven't beaten mine lizards
			add_string(1);
		add_string(2);
		set_flag(5,5,1);
	}
	else { //Beat mine lizards
	add_string(3);
	add_string(4);
}
	break;
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = (get_flag(200,1) == 1) && (get_flag(5,6) != 1);
	question = "We've killed the lizards in the mine.";
	text1 = "He listens as you explain what happened. _That's not good. We've never heard of groups that large. I suppose I should reassign a few guards to the mines._";
	text2 = "_But don't let me get ahead of myself... I should reward you for your deed._ He rummages around in his desk for a minute, eventually extracting a few jewels.";
	text3 = "_There's always a little money lying around this administration... you've just got to know where to find it._ He hands you the jewels and looks back to his paperwork.";
	code = 
		change_coins(500);
		award_party_xp(500,20);
		set_flag(5,6,1);
	break;
begintalknode 53;
	state = 50;
	nextstate = 51;
	question = "What do you do around here?";
	text1 = "_Well, there's a lot of paperwork, particularly with the mines west of here. I take care of all of that. You get used to it after a while._";
	text2 = "_I supposedly command the army we have at Fort Ouranil - it's to the north of here. That's been keeping me busy lately, what with all of the roaming lizard hordes. A lot of farmers have been attacked, and it's difficult to keep everyone safe._";
	text3 = "_That, and I'm supposed to be our valley's emissary to the Empire, but I don't care much for that._";

begintalknode 54;
	state = 51;
	nextstate = -1;
	question = "Sounds difficult.";
	text1 = "He grins. _Of course it is. But I help keep this valley together, and it's worth it._";
	text2 = "_At least it's better than my last job. I was a sergeant in this valley's army. We had a lot of really rough nights patrolling around here in the old days, particularly when the Order wasn't so well established._";
	text3 = "_Why, I remember one night, our patrol stopped at the Drunken Flounder and got a bit drunk. We mistook a few local mailboxes for bandits... and you can guess what happened next._";
	text4 = "Mayor Maler sighs. _I was discharged for disorderly conduct, and my friends gave me a new nickname, though I'm sure you're not interested in that._";
	text5 = "_Anyway, somehow I was elected mayor, and here I am today, doing paperwork._";

begintalknode 55;
	state = 50;
	nextstate = 52;
	question = "What do you think of the Order?";
	text1 = "He pauses thoughtfully. _Well, they're probably the best thing that's ever happened to this valley. They drove out the monsters that controlled the valley, and in doing so made it actually bearable to us._";
	text2 = "_They helped build this town, helped the farms around here get established, and taught us all how to keep in tune with nature. They've even defended us from a small tribe of Vahnatai that attacked us for some reason._";
	text3 = "_The Order has made this valley what it is today, and everyone in this valley should be grateful for their guiding presence. That's why we encourage you to continue on your quest and find Ephesos._";

begintalknode 56;
	state = 52;
	nextstate = -1;
	question = "Wait... Vahnatai?";
	text1 = "_Yes, it was a very tough time for us. Apparently, the Empire wronged the Vahnatai somehow, and they declared war on all surface-dwelling people, which regrettably included us._";
	text2 = "_We first noticed something was wrong when cockroaches appeared everywhere. We had heard of similar plagues in Valorim, and Ephesos quickly learned of the connection between those plagues and the Vahnatai._";
	text3 = "_Once the Order cleared out the biggest roach nests, even more appeared. The druids held them off until Ephesos was able to negotiate the Vahnatai in charge of the invasion of our valley._";
	text4 = "_Once they learned that we had no connection to the Empire, they left us alone, though I'm personally not sure that Ephesos trusted them to keep their word._";
	text5 = "_Ephesos said that vengeance had driven them mad. But in any case, they've left us in peace for now._";

